'''
窗口截图的常用方法：
(1)get_screenshot_as_file()		截图函数
(2)save_screenshot()			截图函数
'''
from selenium import webdriver
from selenium.webdriver.common.by import By
from time import sleep
chrome_location = r'D:\chrom browser\chrome-win\chrome.exe'
options = webdriver.ChromeOptions()
options.binary_location = chrome_location
dr = webdriver.Chrome(options=options)
dr.get(r'https://www.baidu.com/')
sleep(3)
# dr.get_screenshot_as_file(r'baidu.png')
# dr.save_screenshot(r'baidu2.png')

#文件上传
dr.find_element(By.CLASS_NAME,'soutu-btn').click()
dr.find_element(By.CLASS_NAME,'upload-pic').send_keys(r'D:\python_project\homework\liumengdan\Days_practice\Auto\模拟鼠标键盘操作\baidu.png')
sleep(8)
dr.quit()